package cn.lingyangwl.agile.pay.client.model.mq;

import cn.lingyangwl.agile.model.module.mq.AbstractMQ;
import cn.lingyangwl.agile.model.module.mq.BaseMqPayload;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * @author shenguangyang
 */
@Getter
@Setter
public class GoodsOrderCloseMQ extends AbstractMQ {
    /**
     * 延迟队列, 不能被消费监听
     */
    public static final String DELAY_QUEUE = "goods_service.close.delay.queue";

    /**
     * 进入到延迟队列的routingKey
     */
    public static final String DELAY_ROUTING_KEY = "goods_service.close.delay.routing.key";

    /**
     * 过期时间, ms单位, 上线了请改成30分钟
     */
    public static final Integer TTL = 1000 * 60;

    public GoodsOrderCloseMQ(MsgPayload msgPayload) {
        super(msgPayload);
    }

    @Getter
    @Setter
    @AllArgsConstructor
    public static class MsgPayload extends BaseMqPayload {
        private String mchOrderNo;
        private Long userId;
    }

    public static GoodsOrderCloseMQ build(String mchOrderNo, Long userId) {
        return new GoodsOrderCloseMQ(new MsgPayload(mchOrderNo, userId));
    }
}
